﻿using SmartPlant.Model;
using SqlSugar;
using System;
using System.Collections.ObjectModel;

namespace DbContext
{
    /// <summary>
    ///
    ///</summary>
    [SugarTable("REVISION")]
    public class Revision:MetaDataEntity
    {

        public Revision() 
        {
            RevId = 0m;
            RevNo = "";
            RevCreateBy = "";
            RevDesc = "";
            RevChkBy = "";
            RevApprBy = "";
            RevSign = "";
            RevDate = DateTime.Now;
        }
        public bool IsNew { get; set; } = false;
        /// <summary>
        ///
        ///</summary>
        [SugarColumn(ColumnName = "REV_ID", IsPrimaryKey = true)]
        public decimal RevId { get; set; }

        /// <summary>
        ///
        ///</summary>
        [SugarColumn(ColumnName = "DWG_ID", IsPrimaryKey = true)]
        public decimal DwgId { get; set; }

        /// <summary>
        ///
        ///</summary>
        [SugarColumn(ColumnName = "PROJ_ID")]
        public decimal ProjId { get; set; }

        /// <summary>
        ///
        ///</summary>
        [SugarColumn(ColumnName = "SITE_ID")]
        public decimal SiteId { get; set; }

        /// <summary>
        ///
        ///</summary>
        [SugarColumn(ColumnName = "CHG_NUM")]
        public decimal ChgNum { get; set; }

        /// <summary>
        ///
        ///</summary>
        [SugarColumn(ColumnName = "CHG_STATUS")]
        public string ChgStatus { get; set; }

        /// <summary>
        ///
        ///</summary>
        [SugarColumn(ColumnName = "CHG_DATE")]
        public DateTime? ChgDate
        {
            get
            {
                return _ChgDate;
            }
            set
            {
                _ChgDate = value;
                OnPropertyChanged(nameof(ChgDate));
            }

        }
        private DateTime? _ChgDate;

        /// <summary>
        ///
        ///</summary>
        [SugarColumn(ColumnName = "USER_NAME")]
        public string UserName
        {
            get
            {
                return _UserName;
            }
            set
            {
                _UserName = value;
                OnPropertyChanged(nameof(UserName));
            }

        }
        private string _UserName;

        /// <summary>
        ///
        ///</summary>
        [SugarColumn(ColumnName = "PLANT_ID")]
        public decimal PlantId { get; set; }

        /// <summary>
        ///
        ///</summary>
        [SugarColumn(ColumnName = "AREA_ID")]
        public decimal AreaId { get; set; }

        /// <summary>
        ///
        ///</summary>
        [SugarColumn(ColumnName = "UNIT_ID")]
        public decimal UnitId { get; set; }

        /// <summary>
        ///
        ///</summary>
        [SugarColumn(ColumnName = "REV_NO")]
        public string RevNo
        {
            get
            {
                return _RevNo;
            }
            set
            {
                _RevNo = value;
                OnPropertyChanged(nameof(RevNo));
            }

        }
        private string _RevNo;

        /// <summary>
        ///
        ///</summary>
        [SugarColumn(ColumnName = "REV_CREATE_BY")]
        public string RevCreateBy
        {
            get
            {
                return _RevCreateBy;
            }
            set
            {
                _RevCreateBy = value;
                OnPropertyChanged(nameof(RevCreateBy));
            }

        }
        private string _RevCreateBy;

        /// <summary>
        ///
        ///</summary>
        [SugarColumn(ColumnName = "REV_DATE")]
        public DateTime? RevDate
        {
            get
            {
                return _RevDate;
            }
            set
            {
                _RevDate = value;
                OnPropertyChanged(nameof(RevDate));
            }

        }
        private DateTime? _RevDate;

        /// <summary>
        ///
        ///</summary>
        [SugarColumn(ColumnName = "REV_DESC")]
        public string RevDesc
        {
            get
            {
                return _RevDesc;
            }
            set
            {
                _RevDesc = value;
                OnPropertyChanged(nameof(RevDesc));
            }

        }
        private string _RevDesc;


        /// <summary>
        ///
        ///</summary>
        [SugarColumn(ColumnName = "REV_CHK_BY")]
        public string RevChkBy
        {
            get
            {
                return _RevChkBy;
            }
            set
            {
                _RevChkBy = value;
                OnPropertyChanged(nameof(RevChkBy));
            }

        }
        private string _RevChkBy;
        /// <summary>
        ///
        ///</summary>
        [SugarColumn(ColumnName = "REV_APPR_BY")]
        public string RevApprBy
        {
            get
            {
                return _RevApprBy;
            }
            set
            {
                _RevApprBy = value;
                OnPropertyChanged(nameof(RevApprBy));
            }

        }
        private string _RevApprBy;

        /// <summary>
        ///
        ///</summary>
        [SugarColumn(ColumnName = "REV_SIGN")]
        public string RevSign
        {
            get
            {
                return _RevSign;
            }
            set
            {
                _RevSign = value;
                OnPropertyChanged(nameof(RevSign));
            }

        }
        private string _RevSign;

        /// <summary>
        ///
        ///</summary>
        [SugarColumn(ColumnName = "REV_UDF_C01")]
        public string RevUdfC01 { get; set; }

        /// <summary>
        ///
        ///</summary>
        [SugarColumn(ColumnName = "REV_UDF_C02")]
        public string RevUdfC02 { get; set; }

        /// <summary>
        ///
        ///</summary>
        [SugarColumn(ColumnName = "REV_UDF_C03")]
        public string RevUdfC03 { get; set; }

        /// <summary>
        ///
        ///</summary>
        [SugarColumn(ColumnName = "REV_UDF_C04")]
        public string RevUdfC04 { get; set; }

        /// <summary>
        ///
        ///</summary>
        [SugarColumn(ColumnName = "REV_UDF_C05")]
        public string RevUdfC05 { get; set; }

        /// <summary>
        ///
        ///</summary>
        [SugarColumn(ColumnName = "REV_UDF_C06")]
        public string RevUdfC06 { get; set; }

        /// <summary>
        ///
        ///</summary>
        [SugarColumn(ColumnName = "REV_UDF_C07")]
        public string RevUdfC07 { get; set; }

        /// <summary>
        ///
        ///</summary>
        [SugarColumn(ColumnName = "REV_UDF_C08")]
        public string RevUdfC08 { get; set; }

        /// <summary>
        ///
        ///</summary>
        [SugarColumn(ColumnName = "REV_UDF_C09")]
        public string RevUdfC09 { get; set; }

        /// <summary>
        ///
        ///</summary>
        [SugarColumn(ColumnName = "REV_UDF_C10")]
        public string RevUdfC10 { get; set; }

        /// <summary>
        ///
        ///</summary>
        [SugarColumn(ColumnName = "REV_UDF_C11")]
        public string RevUdfC11 { get; set; }

        /// <summary>
        ///
        ///</summary>
        [SugarColumn(ColumnName = "REV_UDF_C12")]
        public string RevUdfC12 { get; set; }

        /// <summary>
        ///
        ///</summary>
        [SugarColumn(ColumnName = "REV_UDF_C13")]
        public string RevUdfC13 { get; set; }

        /// <summary>
        ///
        ///</summary>
        [SugarColumn(ColumnName = "REV_UDF_C14")]
        public string RevUdfC14 { get; set; }

        /// <summary>
        ///
        ///</summary>
        [SugarColumn(ColumnName = "REV_UDF_C15")]
        public string RevUdfC15 { get; set; }

        /// <summary>
        ///
        ///</summary>
        [SugarColumn(ColumnName = "REV_UDF_C16")]
        public string RevUdfC16 { get; set; }

        /// <summary>
        ///
        ///</summary>
        [SugarColumn(ColumnName = "REV_UDF_C17")]
        public string RevUdfC17 { get; set; }

        /// <summary>
        ///
        ///</summary>
        [SugarColumn(ColumnName = "REV_UDF_C18")]
        public string RevUdfC18 { get; set; }

        /// <summary>
        ///
        ///</summary>
        [SugarColumn(ColumnName = "REV_UDF_C19")]
        public string RevUdfC19 { get; set; }

        /// <summary>
        ///
        ///</summary>
        [SugarColumn(ColumnName = "REV_UDF_C20")]
        public string RevUdfC20 { get; set; }

        /// <summary>
        ///
        ///</summary>
        [SugarColumn(ColumnName = "PKG_REV_ID")]
        public decimal? PkgRevId { get; set; }

        public static implicit operator Revision(ObservableCollection<Revision> v)
        {
            throw new NotImplementedException();
        }
    }
}